//
//  ZTCraryUtils.h
//  ZTSDKDemo
//
//  Created by 武得亮 on 2021/3/17.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN

@interface ZTCraryUtils : NSObject

/**
 * 生成纯色图片
 */
+ (UIImage *)createImageWithColor:(UIColor *)color frame:(CGRect)rect;

/**
 * 验证一个纯数字字符串
 */
+ (BOOL)validateNumber:(NSString *) textString;

/**
 * 验证手机号
 */
+ (BOOL)validatePhoneNum:(NSString *)phoneNum;

/**
 * 简单设置一个字符串的富文本
 */
+ (NSAttributedString *)generateAttributedStringWithString:(NSString *)contentStr location:(NSInteger )location leftStrFont:(CGFloat) leftFont leftStrColor:(UIColor *)leftColor rightStrFont:(CGFloat) rightFont rightStrColor:(UIColor *)rightColor;
/**
 * 获取当前控制器
 */
+ (UIViewController *)getCurrentVC;

/**
 * 把数字转化成字符串
 */
+ (NSString *)generateStringByInt:(int)count;

/**
 * 时间戳转化时间
 */
+ (NSString *)timestampTransformToTimeString:(NSString *)timestamp;

/**
 * rsa 公钥字符串加密 私钥解密
 */
+ (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey;
+ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey;
/**
 * base64 加密
 */
+ (NSString *)base64Encryption:(NSString *)contentString;

/**
 * 某段范围替换字符串
 */
+ (NSString *)replaceContentString:(NSString *)contentString WithString:(NSString *)replaceString range:(NSRange)range;

/**
 * 随机生成一个字符串
 */
+ (NSString *)generateRandomString:(NSInteger) length;


/**
 * 展示tost提示
 */
+ (void)showHudOnWindow:(NSString *)text;


/**
 * 添加四边阴影效果
 */
+ (void)addShadowToView:(UIView *)theView withColor:(UIColor *)theColor;


/**
 * 把数组对象转化成字符串
 */
+ (NSString *)convertStringFromArray:(NSArray *)array;


/**
 * 把字符串转化成数组
 */
+ (NSArray *)convertToArrayFromString:(NSString *)string;


/**
 * iOS13 deviceToken 获取
 */
+ (NSString *)getCommonDeviceToken:(NSData *)data;

//----自己扩展的---
/**enable yes 开启长亮 开启 靠近变黑 no 相反*/
+ (void)setCallScreenLightEnabled:(BOOL)enable;

@end

NS_ASSUME_NONNULL_END
